﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AppCode_Employee_CompanyDetails : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["userNameEmployee"] == null)
            {
                Response.Redirect("../Home/HomePage.aspx");
            }
            else
            {

                int Companyid = Convert.ToInt32(Request.QueryString["companyId"]);
                String connect = WebConfigurationManager.ConnectionStrings["ConnectDatabase"].ToString();
                SqlConnection sqlConnect = new SqlConnection(connect);
                sqlConnect.Open();
                SqlCommand sqlCommand = new SqlCommand("Select *from CompanyDetails where companyId=" + Companyid, sqlConnect);
                SqlDataReader reader = sqlCommand.ExecuteReader();
                reader.Read();
                lbConpanyId.Text = reader.GetInt32(0).ToString();
                lbCompanyName.Text = reader.GetString(1);
                lbAddress.Text = reader.GetString(2);
                lbPhone.Text = reader.GetString(3);
                lbCompanyUrl.Text = reader.GetString(4);
                sqlConnect.Close();

            }
        }
    }

}